<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>系统登录 - 超市订单管理系统</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/style.css" />
    <script type="text/javascript">

        function validateForm() {
            var userCode = document.getElementById("userCode").value;
            var userPassword = document.getElementById("userPassword").value;
            var userReg = /^\w{5,15}$/;
            /*if(!userReg.test(userCode)){//用户名的校验
                alert("请输入5-15位的字母和数字");
                return false;
            }*/
            var pwdReg = /^\w{4,10}$/;
            if(!pwdReg.test(userPassword)){
                alert("请输入4-10位的字母和数字");
                return false;
            }
            return true;
        }
    </script>
</head>
<body class="login_bg">
    <section class="loginBox">
        <header class="loginHeader">
            <h1>超市订单管理系统</h1>
        </header>
        <section class="loginCont">
	        <form class="loginForm" action="${pageContext.request.contextPath }/user/dologin"
                  name="actionForm" id="actionForm"  method="post" onsubmit="validateForm();" >
				<div class="info">${error }</div>
				<div class="inputbox">
                    <label for="userCode">用户名：</label>
					<input type="text" class="input-text" id="userCode" name="userCode" placeholder="请输入用户名" required/>
				</div>	
				<div class="inputbox">
                    <label for="userPassword">密码：</label>
                    <input type="password" id="userPassword" name="userPassword" placeholder="请输入密码" required/>
                </div>	
				<div class="subBtn">
                    <input type="submit" value="登录"/>
                    <input type="reset" value="重置"/>
                </div>	
			</form>
        </section>
    </section>
</body>
</html>
